package com.esun.cheetah.biz.news;

import java.util.HashMap;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.os.Handler;

import com.esun.cheetah.biz.personal.personalinfo.UserInfo;
import com.esun.cheetah.config.Key;
import com.esun.cheetah.model.news.NewsHuoDContentBean;
import com.esun.cheetah.network.AbsInferiorityCommunicater;
import com.esun.util.log.EDebug;

public class NewsContentCommunicater extends AbsInferiorityCommunicater {

  private NewsHuoDContentBean List;
  private String id;
  private String activityHeadNote;
//  private String content1;
  private String id1;
  public NewsHuoDContentBean getList() {
    return this.List;
  }

  public void setList(NewsHuoDContentBean list) {
    this.List = list;
  }

  public String getId() {
    return this.id;
  }

  public void setId(String id) {
  this.id = id;}
  

  public String getBigtitle() {
    return this.bigtitle;
  }

  public void setBigtitle(String bigtitle) {
  this.bigtitle = bigtitle;}
  

  public String getNote() {
    return this.note;
  }

  public void setNote(String note) {
  this.note = note;}
  

  public String getActivityTime() {
    return this.activityTime;
  }

  public void setActivityTime(String activityTime) {
  this.activityTime = activityTime;}
  

  public String getContent() {
    return this.content;
  }

  public void setContent(String content) {
  this.content = content;}
  

  public String getActivityRule() {
    return this.activityRule;
  }

  public void setActivityRule(String activityRule) {
  this.activityRule = activityRule;}
  

  public String getActivityNotes() {
    return this.activityNotes;
  }

  public void setActivityNotes(String activityNotes) {
  this.activityNotes = activityNotes;}
  

  public String getImageurl() {
    return this.imageurl;
  }

  public void setImageurl(String imageurl) {
  this.imageurl = imageurl;}
  

  public String getOpruser() {
    return this.opruser;
  }

  public void setOpruser(String opruser) {
  this.opruser = opruser;}
  

  public String getOprtime() {
    return this.oprtime;
  }

  public void setOprtime(String oprtime) {
  this.oprtime = oprtime;}
  

  public String getGoodcnt() {
    return this.goodcnt;
  }

  public void setGoodcnt(String goodcnt) {
  this.goodcnt = goodcnt;}
  

  public String getBadcnt() {
    return this.badcnt;
  }

  public void setBadcnt(String badcnt) {
  this.badcnt = badcnt;}
  

  public NewsHuoDContentBean getListBean() {
    return this.ListBean;
  }

  public void setListBean(NewsHuoDContentBean listBean) {
    this.ListBean = listBean;
  }

  //大字儿
  private String bigtitle;
  //小字儿
  private String note;
  //活动时间
  private String activityTime;
  //活动内容
  private String content;
  //活动规则
  private String activityRule;
  //活动温馨提示
  private String activityNotes;
  //
  private String imageurl;
  //
  private String opruser;
  //
  private String oprtime;
  //
  private String goodcnt;
  //
  private String badcnt;
  NewsHuoDContentBean ListBean = new NewsHuoDContentBean();
//  private String username;

  public NewsContentCommunicater(Handler handler, String id) {
    super(handler);
    List = new NewsHuoDContentBean();
    this.id = id;
//    this.username = username;

  }

  @Override
  public HashMap<String, String> comHashMap() {
    
    HashMap<String, String> hmJson = new HashMap<String, String>();

    hmJson.put(Key.KEY_ID, "10037");
    hmJson.put("cid", id);
    hmJson.put("username", UserInfo.getUserInfo().getUserName());
    return hmJson;

  }

  /**
   * @return
   * @throws JSONException
   * @Title: getJsonContent
   * @Description: 解析json
   * @param
   * @return Object
   * @throws
   */
  @Override
  public void getJsonContent(String serverRes) throws JSONException {
    

    JSONObject jsonObject = new JSONObject(serverRes);
    JSONArray artr = jsonObject.getJSONArray(Key.KEY_DATA);
    
      JSONObject localJs = artr.getJSONObject(0);
        
        EDebug.o("从新开始解析===》 ");
        
        id1 = localJs.getString("id"); //
        EDebug.o("新闻id--->" + getId1());
        bigtitle = localJs.getString("bigtitle"); //
        EDebug.o("大标题--->" + getBigtitle());
        
        note = localJs.getString("note"); //
        EDebug.o("小标题--->" + getNote());
        
        activityTime = localJs.getString("activityTime"); //
        EDebug.o("活动时间--->" + getActivityTime());
        
        content = localJs.getString("content"); //
        EDebug.o("活动内容--->" + getContent());
        
//        content1 = localJs.getString("content"); //
//        EDebug.o("活动内容--->" + getContent());
        
        activityRule = localJs.getString("activityRule"); //
        EDebug.o("活动规则--->" + getActivityRule());
        activityNotes = localJs.getString("activityNotes"); //
        EDebug.o("活动状态--->" + getActivityNotes());
        activityHeadNote = localJs.getString("activityHeadNote"); //
        EDebug.o("活动状态--->" + getActivityNotes());
        
//       setActivityHeadNote(localJs.getString("activityHeadNote")); //
//        EDebug.o("活动状态--->" + getActivityHeadNote());

      }
     

 
  
  public NewsHuoDContentBean getLotteryList() {
    return ListBean;
  }

  public void setLotteryList(NewsHuoDContentBean ListBean) {
    this.ListBean=ListBean;
  }

  public String getId1() {
    return this.id1;
  }

  public void setId1(String id1) {
    this.id1 = id1;
  }

  public String getActivityHeadNote() {
    return this.activityHeadNote;
  }

  public void setActivityHeadNote(String activityHeadNote) {
    this.activityHeadNote = activityHeadNote;
  }

//  public String getContent1() {
//    return this.content1;
//  }
//
//  public void setContent1(String content1) {
//    this.content1 = content1;
//  }
}